package com.wcity.manage.dao.mapper;

import com.wcity.manage.dao.dal.BaseMapper;
import com.wcity.manage.dao.model.ModuleManage;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
 * Created by jn on 2016/12/9.
 * 用户模块管理
 */
@Repository
public interface ModuleManageMapper extends BaseMapper<ModuleManage,Serializable> {

    /**
     * 查询
     * @param userId
     * @return
     */
    @Select(" select * from td_manage_module_manage where user_id = #{userId} ")
    ModuleManage findByUserId(int userId);

    /**
     * 获取在线用户id
     * @return
     */
    @Select(" select user_id from td_manage_module_manage where status = 1 ")
    List<Integer> findOnlineUser();

}
